package com.davidk.survey.client.eventbus;

import com.davidk.survey.client.dataviewer.DataPresenter;
import com.davidk.survey.client.home.HomePresenter;
import com.davidk.survey.client.login.LoginPresenter;
import com.davidk.survey.client.menu.FunctionMenuPresenter;
import com.davidk.survey.client.root.RootPresenter;
import com.davidk.survey.client.root.RootView;
import com.google.gwt.user.client.ui.Widget;
import com.mvp4g.client.annotation.Event;
import com.mvp4g.client.annotation.Events;
import com.mvp4g.client.annotation.Start;
import com.mvp4g.client.event.EventBus;
import com.smartgwt.client.widgets.Canvas;

//start view is the view that will be automatically added to the RootPanel/RootLayoutPanel
@Events(startView = RootView.class)
public interface MasterEventBus extends EventBus {

	@Start
	@Event(handlers = { LoginPresenter.class })
	public void start();

	@Event(handlers = { RootPresenter.class, FunctionMenuPresenter.class, HomePresenter.class })
	public void loginSuccess(String userId);

	@Event(handlers = RootPresenter.class)
	public void changeBody(Canvas widget);

	@Event(handlers = RootPresenter.class)
	public void changeMenu(Canvas widget);

	@Event(handlers = RootPresenter.class)
	public void changeTitle(Canvas widget);

	@Event(handlers = RootPresenter.class)
	public void displayMessage(String message);

	@Event(handlers = { FunctionMenuPresenter.class, HomePresenter.class, DataPresenter.class })
	public void showFunction(String fnType, String fnData);

}
